package org.alex.netShop.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.alex.netShop.interfaces.Purchase;





public class PurchasesBean implements Purchases{
	
	private Map<String, Purchase> purchases = new HashMap<String, Purchase>();
	
	public Collection<Purchase> retrive(){
		return purchases.values();
	}
	public Purchase save(Purchase purchase){
		return purchases.put(purchase.getId(),purchase);
	}
	public Purchase retrieveSinglePurchase(String id) {
		return purchases.get(id);
	}
	
	

}
